#ifndef __SERIAL_H
#define __SERIAL_H

#ifdef __cplusplus
 extern "C" {
#endif
	 /*----------------------------------------------------------------------------------------------*/
	#include "misc.h"

	typedef enum
	{
		NO_ERR,
		TIME_OUT,
	}USART_Error;
	typedef enum
	{
		RX_IT,
		TX_IT,
	}USART_Interrupt;
//	typedef struct
//	{
//		char phone_number[15];
//		char *content;
//		char *time;
//		char *date;
//	}SMS_Sender;
//	typedef struct
//	{
//		char *phone_number;
//		char *content;
//		char *time;
//		char *date;
//	}SMS_Receiver;
	// timeOut_1byte duoc su dung trong exception cua SysTick Timer
	extern uint32_t timeOut_1byte;
	extern uint8_t pc_allow_send;
	extern void USART_SendByte(USART_TypeDef* usart,uint8_t data);
	extern void USART_SendString(USART_TypeDef* usart,char* data);
	extern void USART_SendByteArray(USART_TypeDef* usart,char* data, uint32_t length);
	extern USART_Error USART_ReceiveByte(USART_TypeDef* usart, uint8_t *c, uint32_t timeOut);
	extern void USART_DisableInterrupt(USART_TypeDef* usart,USART_Interrupt it);
	extern void USART_EnableInterrupt(USART_TypeDef* usart,USART_Interrupt it);
	 /*------------------------------------------------------------------------;-----------------------*/

	 
#ifdef __cplusplus
}
#endif

#endif /* __MISC_H */
